package com.yugao.fintech.antelope.pay.payment.channel;

import com.yugao.fintech.antelope.pay.constant.IfCodeEnum;
import com.yugao.fintech.antelope.pay.model.entity.PayOrder;
import com.yugao.fintech.antelope.pay.model.entity.RefundOrder;
import com.yugao.fintech.antelope.pay.model.rqrs.pay.refund.RefundOrderRQ;
import com.yugao.fintech.antelope.pay.payment.model.bo.MchAppConfigContext;
import com.yugao.fintech.antelope.pay.payment.model.rqrs.ChannelRetMsgExt;

/**
 * 调起上游渠道侧退款接口
 *

 */
public interface IRefundService {

    /**
     * 获取到接口code
     */
    IfCodeEnum getIfCode();

    /**
     * 前置检查如参数等信息是否符合要求， 返回错误信息或直接抛出异常即可
     */
    String preCheck(RefundOrderRQ bizRQ, RefundOrder refundOrder, PayOrder payOrder);

    /**
     * 调起退款接口，并响应数据；  内部处理普通商户和服务商模式
     */
    ChannelRetMsgExt refund(RefundOrderRQ bizRQ, RefundOrder refundOrder, PayOrder payOrder, MchAppConfigContext mchAppConfigContext) throws Exception;

    /**
     * 退款查单接口
     */
    ChannelRetMsgExt query(RefundOrder refundOrder, MchAppConfigContext mchAppConfigContext) throws Exception;

}
